﻿using System;
using System.ComponentModel.DataAnnotations;

namespace ORS.OrderRobot.ServiceContracts.Dtos
{

    /// <summary>
    /// 账号基本信息
    /// </summary>
    public class AccountBasicInput
    {
        /// <summary>
        /// 邮箱
        /// </summary>
        [Required(ErrorMessage = "邮箱不能为空")]
        [RegularExpression(@"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$", ErrorMessage = "邮箱格式不正确")]
        public string Email { get; set; }
        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage = "密码不能为空")]
        public string Password { get; set; }
    }
    public class AccountBoardingInput
    {
        /// <summary>
        /// 客户姓名(可以是中文，也可以是YANG YAOWU)
        /// </summary>
        [Required(ErrorMessage = "姓名不能为空")]
        public string CustomName { get; set; }
        /// <summary>
        /// 生日
        /// </summary>
        [Required(ErrorMessage = "生日不能为空")]
        [RegularExpression(@"^(?:\d{4}[-/]\d{2}[-/]\d{2})$", ErrorMessage = "日期格式必须是 yyyy/MM/dd 或 yyyy-MM-dd")]
        public string Birthday { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        [Required(ErrorMessage = "手机号必须填写")]
        [RegularExpression(@"^1[3-9]\d{9}$", ErrorMessage = "手机号不正确")]
        public string Mobile { get; set; }
        /// <summary>
        /// 航班号:3U3964
        /// </summary>
        [Required(ErrorMessage = "航班号不能为空")]
        [RegularExpression(@"^([A-Za-z0-9]{2})(\d{3,4})$", ErrorMessage = "航班号格式不正确")]
        public string FlightNo { get; set; }
        /// <summary>
        /// 航班出发日期(格式:2025/06/17)
        /// </summary>
        [Required(ErrorMessage = "出发日期不能为空")]
        [RegularExpression(@"^(?:\d{4}[-/]\d{2}[-/]\d{2})$", ErrorMessage = "日期格式必须是 yyyy/MM/dd 或 yyyy-MM-dd")]
        public string DepartureDate { get; set; }
        /// <summary>
        /// 航班出发时间(格式:14:07)
        /// </summary>
        [Required(ErrorMessage = "出发时间不能为空")]
        [RegularExpression(@"^([01]?[0-9]|2[0-3]):([0-5]?[0-9])$", ErrorMessage = "时间格式必须是 HH:mm")]
        public string DepartureTime { get; set; }
    }
    /// <summary>
    /// 用户信息（必须先在三方平台创建账号）
    /// </summary>
    public class AccountInput
    {
        public AccountBasicInput BaiscInfo { get;set; }

        public AccountBoardingInput? BoardingInfo { get; set; }
    }
}

